//
//  MyView.m
//  <17.0>键盘事件
//
//  Created by chen on 16/9/19.
//  Copyright © 2016年 tyrad. All rights reserved.
//

#import "MyView.h"

@implementation MyView

- (void)drawRect:(NSRect)dirtyRect {
    [super drawRect:dirtyRect];
    
    // Drawing code here.
}


//如果处理键盘事件则返回YES
- (BOOL)acceptsFirstResponder{
    return YES ;
}

//询问接受者是否愿意放弃FirstResponder的地位
- (BOOL)resignFirstResponder{
    return YES;
}

//通知接受者它已经成为window的responder了
- (BOOL)becomeFirstResponder{
    return YES;
}

//按下一个键
- (void)keyDown:(NSEvent *)event{
 
    
}

//抬起一个键
- (void)keyUp:(NSEvent *)event{

}

//按下或者放开修饰键
- (void)flagsChanged:(NSEvent *)event{

}


 

@end













